import request from '@/utils/request'

// 查询品检不良项目列表
export function listDefectiveItem(query) {
  return request({
    url: '/quality/defectiveItem/list',
    method: 'get',
    params: query
  })
}

// 查询品检不良项目详细
export function getDefectiveItem(bllYydm) {
  return request({
    url: '/quality/defectiveItem/' + bllYydm,
    method: 'get'
  })
}

// 新增品检不良项目
export function addDefectiveItem(data) {
  return request({
    url: '/quality/defectiveItem',
    method: 'post',
    data: data
  })
}

// 修改品检不良项目
export function updateDefectiveItem(data) {
  return request({
    url: '/quality/defectiveItem',
    method: 'put',
    data: data
  })
}

// 更改品检不良项目状态
export function changedDefectiveItemFlag(bllYydm, bllFlag) {
  return request({
    url: '/quality/defectiveItem',
    method: 'put',
    data: {
      bllYydm: bllYydm,
      bllFlag: bllFlag
    }
  })
}

// 删除品检不良项目
export function delDefectiveItem(bllYydm) {
  return request({
    url: '/quality/defectiveItem/' + bllYydm,
    method: 'delete'
  })
}

// 导出品检不良项目
export function exportDefectiveItem(query) {
  return request({
    url: '/quality/defectiveItem/export',
    method: 'get',
    params: query
  })
}
